<?php
define ('HOSTNAME', 'http://129.252.37.86/');

$path = ($_POST['url']) ? $_POST['url'] : $_GET['url'];
#$url = HOSTNAME.$path;
$decodedURI = rawurldecode( $path );
#echo( $options );
if( strstr( $decodedURI, HOSTNAME ) )
{
  $session = curl_init($decodedURI);
  if ($_POST['MAP']) {
    $postvars = '';
    while ($element = current($_POST)) {
      $postvars .= key($_POST).'='.$element.'&';
      next($_POST);
    }
    #echo( $postvars );
    curl_setopt ($session, CURLOPT_POST, true);
    curl_setopt ($session, CURLOPT_POSTFIELDS, $postvars);
  }

  curl_setopt($session, CURLOPT_HEADER, false);
  curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

  $xml = curl_exec($session);

  header("Content-Type: text/xml");

  echo $xml;
  curl_close($session);
}
?>